import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/style.scss'
import ElementPlus, { ElMessage, ElNotification } from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import * as echarts from 'echarts'
import BaiduMap from 'vue-baidu-map-3x'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'u53wPOQjSxmTcG3AVEFgjsWhaUORcvYT'
  // v:'2.0',  // 默认使用3.0
  // type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
})
app.use(ElementPlus, {
  locale: zhCn
})
app.config.globalProperties.$echarts = echarts
app
  .use(store)
  .use(router)
  .use(ElementPlus) // 使用插件后自动将组件库所有组件注册为全局组件
  .use(ElMessage)
  .use(ElNotification)
  .mount('#app')
